package cn.brickie.abstractfactory;

/***
 * 抽象工厂具体实现
 * 基于给定的信息生成实体类的对象。
 * @author Brickie
 * @date 2018/5/29 10:46
 */
public class ShapeFactory extends AbstractFactory {

    @Override
    public Shape getShape(ShapeType shapeType) {
        switch (shapeType) {
            case SQUARE:
                return new Square();
            case CIRCLE:
                return new Circle();
            case RECTANGLE:
                return new Rectangle();
            default:
                return null;
        }
    }

    @Override
    public Color getColor(ColorFactory.ColorType colorType) {
        return null;
    }

    enum ShapeType {
        CIRCLE,
        RECTANGLE,
        SQUARE
    }
}
